package com.file.system.entity.business;


import cn.hutool.core.util.StrUtil;
import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.alibaba.excel.annotation.write.style.ContentRowHeight;
import com.alibaba.excel.annotation.write.style.HeadRowHeight;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateDeserializer;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateSerializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
import com.file.system.entity.basic.WebBasic;
import com.file.system.plugin.dict.Dict;
import com.file.system.plugin.validated.SQLInjectionValidation;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.validation.groups.Default;
import java.io.Serializable;
import java.time.LocalDate;
import java.time.LocalDateTime;


/**
 * 器具订单
 *
 * @author jch
 */
@Data
@EqualsAndHashCode
@Accessors(chain = false)
@ContentRowHeight(25)
@HeadRowHeight(35)
@ColumnWidth(25)
public class BusUtensilIndentExcel implements Serializable {
    /**
     * id
     */
    @ExcelIgnore
    private long id;
    /**
     * 导入标识
     */
    @ExcelProperty("导入标识")
    private String index;
    /**
     * 证书单位名称
     */
    @ExcelProperty("证书单位")
    private String certificationCompany;
    /**
     * 委托单位名称/发票单位名称
     */
    @ExcelProperty("委托单位")
    private String nameOfEntrustOrg;
    /**
     * 单位地址
     */
    @ExcelProperty("地址")
    private String address;
    /**
     * 联系人
     */
    @ExcelProperty("联系人")
    private String linkman;
    /**
     * 联系电话
     */
    @ExcelProperty("联系电话")
    private String linkPhone;
    /**
     * 邮编
     */
    @ExcelProperty("邮编")
    private String zipCode;
    /**
     * 委托日期
     */
    @ExcelProperty("委托日期")
    private LocalDate entrustDate;
    /**
     * 受理日期
     */
    @ExcelProperty("受理日期")
    private LocalDate acceptDate;
    /**
     * 受理人员
     */
    @ExcelProperty("受理人")
    private String accepterSign;

    /**
     * 器具来源 下厂 送检
     * todo:前表赋值
     */
    private String dictCheckType;

    public void setDictCheckType(String dictCheckType) {
        if (StrUtil.isEmpty(dictCheckType)) {
            return;
        }
        switch (dictCheckType) {
            case "scene":
                this.dictCheckType = "下厂";
                break;
            case "submission":
                this.dictCheckType = "送检";
                break;
            default:
                break;
        }
    }
}
